// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import router from './router'

import Axios from 'axios'

import VueLazyload from 'vue-lazyload'

import './lib/dist/css/mui.min.css'
import './lib/dist/css/icons-extra.css'

import VuePreview from 'vue-preview'

import store from './store'

// defalut install
Vue.use(VuePreview)

Vue.use(MintUI)

Vue.use(VueLazyload, {
  error: 'dist/error.png', // 这个是请求失败后显示的图片
  loading: 'dist/loading.gif', // 这个是加载的loading过渡效果
  try: 2 // 这个是加载图片数量
})

Vue.prototype.$axios = Axios

Vue.filter('dateFormat', (val) => {
  var dt = new Date(val)

  var y = dt.getFullYear()
  var m = dt.getMonth() + 1
  var d = dt.getDate()
  return `${y}-${m.toString().padStart(2, '0')}-${d.toString().padStart(2, '0')}`
})

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  store,
  template: '<App/>'
})
